package com.lyf.boot.listener;

import com.lyf.boot.constant.RabbitMqConstant;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author Luyufan
 * @date 2023/12/8 18:49
 **/
@Component
@Slf4j
public class TopicListener {

//    @RabbitListener(bindings = @QueueBinding(value = @Queue(name = RabbitMqConstant.TOPIC_QUEUE_A)
//            ,exchange = @Exchange(name = RabbitMqConstant.TOPIC_EXCHANGE,type = ExchangeTypes.TOPIC),key = RabbitMqConstant.TOPIC_ROUTING))
    @RabbitListener(queues = RabbitMqConstant.TOPIC_QUEUE_A)
    public void topicA(String message){
        log.debug("topicA:{}", message);
    }

    @RabbitListener(queues = RabbitMqConstant.TOPIC_QUEUE_B)
//    @RabbitListener(bindings = @QueueBinding(value = @Queue(name = RabbitMqConstant.TOPIC_QUEUE_B)
//            ,exchange = @Exchange(name = RabbitMqConstant.TOPIC_EXCHANGE,type = ExchangeTypes.TOPIC),key = RabbitMqConstant.TOPIC_ROUTING))
    public void topicB(String message){
        log.debug("topicB:{}", message);
    }
}
